package com.zhong.config;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class ConfigApplication {
    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext context = SpringApplication.run(ConfigApplication.class, args);
        while(true){
            String name = context.getEnvironment().getProperty("user.name");
            String age = context.getEnvironment().getProperty("user.age");
            String sex = context.getEnvironment().getProperty("user.sex");
            System.out.println(name+ "===="+ age+"===="+ sex);
            Thread.sleep(1000);
        }
    }
}
